<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            width: 100%;
            height:  100%;
            overflow: hidden;
        }
        #app{
            width: 100%;
            height: 100%;
            background: gray;
            overflow: auto;
        }

        #test{
            width: 100px;
            height: 100px;
            background: pink;

            /*当前test参照于初始包含块进行定位！*/
            /*初始包含块是一个视窗大小的矩形  默认位置和视窗保持一致*/
            position: absolute;
            top: 50px;
            left: 50px;
        }
    </style>
</head>
<body>
    <div id="app">
        <div style="height: 3000px"></div>
        <div id="test">

        </div>
    </div>
</body>
</html>